﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class EffectUtility : MonoBehaviour
{
    private DeckManager deck;
    private HandCardManager handCard;
    void Start()
    {
        deck = GameObject.Find("deckManager").GetComponent<DeckManager>();
        handCard = GameObject.Find("handCardManager").GetComponent<HandCardManager>();
    }

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            drawOneCardFromDeck();
        }
    }





    /*
    ■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■
    |          效果区域： 给卡牌效果以及游戏中必要逻辑添加元效果          |
    ■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■-■
    */


    /// <summary>
    /// 抽一张卡
    /// </summary>
    public void drawOneCardFromDeck()
    {
        if (deck.playerDeck.cards.Count <= 0)
        {
            return;
        }
        CardBase newCardAttr = deck.GetTopCardFormDeck();
        handCard.AddOneCardInHand(newCardAttr);
        deck.DeleteTopCardFormDeck();
    }
}
